package com.shengyuan.manage_os.old.ying.erpm;

import java.io.UnsupportedEncodingException;
import org.json.JSONArray;

import com.shengyuan.manage_os.R;
import com.shengyuan.manage_os.im.ECApplication;
import com.shengyuan.manage_os.im.ui.settings.SettingsActivity;
import com.shengyuan.manage_os.old.ying.boce.jsy.UpdateManager;
import com.shengyuan.manage_os.old.ying.boce.task.GenericTask;
import com.shengyuan.manage_os.old.ying.boce.task.TaskAdapter;
import com.shengyuan.manage_os.old.ying.boce.task.TaskListener;
import com.shengyuan.manage_os.old.ying.boce.task.TaskParams;
import com.shengyuan.manage_os.old.ying.boce.task.TaskResult;
import com.shengyuan.manage_os.old.ying.erpm.device.BluetoothService3;
import com.shengyuan.manage_os.old.ying.erpm.device.DeviceListActivity;
import com.shengyuan.manage_os.old.ying.erpm.tasks.SubmitUpdateTask;
import com.shengyuan.manage_os.old.ying.erpm.tasks.Submit_System_Setting_Data_Task;
import com.shengyuan.manage_os.old.ying.erpm.util.Utility;
import android.app.Activity;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.ToggleButton;

public class SettingActivity extends Activity implements OnClickListener{
    // Intent request codes
    private static final int REQUEST_CONNECT_DEVICE = 1;
    private static final int REQUEST_ENABLE_BT = 2;
    
	private static String  CITY = "天津";
	private ToggleButton toggleButton_lixian;
	private TextView statusText, statusText_update, statusText_printer;
	private Button btn,btn_download_update, btn_system_exit,btn_printer, btn_printer_n ;
	private Button btn_download_table_update1, btn_download_table_update2, btn_download_table_update3;
	private Button btn_download_table_update4, btn_download_table_update5, btn_download_table_update6;
	private Button btn_download_table_update41, btn_download_table_update42;
	private Button btn_download_table_update7, btn_download_table_update8;
	private Button btn_download_table_update_fuwu, btn_download_table_update_chexing;
	
	private Button btn_download_table_car_setting,btn_download_table_jixie_setting;
	
	private Button btn_download_table_update4_xiangmu,btn_download_table_update41_xiangmu, btn_download_table_update42_xiangmu;
	
//	private OfflineMapManager amapManager=null;
	private boolean hasdown;
	private GenericTask mSubmitTask; 
	
	public static final String FILENAME ="SettingActivity";
	
    // Local Bluetooth adapter
    public static BluetoothAdapter mBluetoothAdapter = null;
    // Member object for the services
    public static BluetoothService3 mService = null;
	@Override
	public void onClick(View v) {
		TaskParams params;
		if (mSubmitTask!=null) {
			mSubmitTask.cancel(true);
			mSubmitTask = null;
		}
		Intent intent;
		switch (v.getId()) {
		case R.id.toggleButton_lixian:
			MainApplication.pShareUtil.WriteParam(Submit_System_Setting_Data_Task.S_LIXIAN, toggleButton_lixian.getText().toString());
			break;
		case R.id.btn_download_table_car_setting:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_WAIZUSHILUN);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_car_setting));
			this.startActivity(intent);
			break;		
		case R.id.btn_download_table_jixie_setting:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_WAIZUJIXIE);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_jixie_setting));
			this.startActivity(intent);
			break;
		case R.id.btn_download:
			if (hasdown) {
				btn.setText(R.string.title_form_setting_btndownload);
				stopButton(v);
			}else {
				btn.setText(R.string.title_form_setting_btnstop);
				downloadMap();
			}
			hasdown = !hasdown;				
			break;
		case R.id.btn_download_update:
			mSubmitTask = new SubmitUpdateTask();
			mSubmitTask.setListener(mTaskListener_UpdateFile);
			params = new TaskParams();
			params.put(SubmitUpdateTask.UPDATEFILE, 
					MainApplication.updatefile);
			
			mSubmitTask.execute(params);
			break;
		case R.id.btn_printer:
            Intent serverIntent = new Intent(this, DeviceListActivity.class);
            startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);
			break;
		case R.id.btn_printer_n:
			sendMessagetoPrinter("\n");
			break;
		case R.id.btn_system_exit:
			finish();
			break;
		case R.id.btn_download_table_update1:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_ZIYOUJIXIE);
//			mSubmitTask.execute(params);
			break;			
		case R.id.btn_download_table_update2:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_WAIZUJIXIE);
//			mSubmitTask.execute(params);
			break;
		case R.id.btn_download_table_update3:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_ZIYOUSHILUN);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);		
			break;	
		case R.id.btn_download_table_update4:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_GC);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update41:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_JX);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update42:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_OA);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update4_xiangmu:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_GC_XIANGMU);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update41_xiangmu:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_JX_XIANGMU);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update42_xiangmu:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_GONGCHENGMINGCHENG_OA_XIANGMU);
//			mSubmitTask.execute(params);	
			break;
		case R.id.btn_download_table_update5:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_GONYINGSHANG);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);					
			break;
		case R.id.btn_download_table_update6:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_CAILIAOMINGCHENG);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);			

			break;	
		case R.id.btn_download_table_update7:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_ZHUANGDI);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);					
			break;	
		case R.id.btn_download_table_update8:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_XIEDI);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);						
			break;		
		case R.id.btn_camera:
//			mSubmitTask = new Submit_System_Setting_Data_Task();
//			mSubmitTask.setListener(mTaskListener);
//			params = new TaskParams();
//			params.put(Submit_System_Setting_Data_Task.TYPENAME, 
//					Submit_System_Setting_Data_Task.T_FUWUXIANMU);
//			mSubmitTask.execute(params);					
			break;		
		case R.id.btn_download_table_update_chexing:
			intent = new Intent( this, Actual_Form_Car_Setting.class);
			intent.putExtra("T_Name", Submit_System_Setting_Data_Task.T_CHEXING);
			intent.putExtra("mTitle", getResources().getString(R.string.title_actual_form_cailiao_setting));
			this.startActivity(intent);					
			break;			
		default:
			break;
		}
	}

	private void downloadMap() {
		boolean start = false;
		try {
//			if (MapUtility.getOfflineMapPath()==null) {
//				Utility.MessageBox("SD卡不存在!不能使用离线功能!");
//				return;
//			}
//			MapsInitializer.sdcardDir = MapUtility.getOfflineMapPath();
//			start = amapManager.downloadByCityName(CITY);
			if (!start) {
				Utility.MessageBox("下载离线地图数据失败");
			} else {
				Utility.MessageBox("开始下载离线地图数据");
			}
		} catch (Exception e) {
			e.printStackTrace();
			Utility.MessageBox("开启下载失败，请检查网络是否开启！");
		}

	}

	@Override
	protected void onStop() {
		super.onStop();
		InitGoldelData();
	}
	public void pauseButton(View view) {
//		amapManager.pause();
		Utility.MessageBox("暂停下载离线地图数据");
	}

	public void stopButton(View view) {
//		amapManager.stop();
		Utility.MessageBox("停止下载离线地图数据");
	}
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.form_setting);
		initcontrols();
//		amapManager = new OfflineMapManager(this, this);
		
	}

	private void initcontrols() {
		btn = (Button) findViewById(R.id.btn_download);
		btn.setOnClickListener(this);
		statusText = (TextView) findViewById(R.id.statusText);
		
//		File file = new File(MapUtility.getOfflineMapPath());
//		if (file.exists()) {
//			if(file.listFiles().length>0){
//				statusText.setText("存在离线地图 ");
//			}else {
//				statusText.setText("没有地图");
//			}
//		}
		
		btn_download_update = (Button) findViewById(R.id.btn_download_update);
		btn_download_update.setOnClickListener(this);
		statusText_update =(TextView) findViewById(R.id.statusText_update);
		try {
			statusText_update.setText(this.getPackageManager().getPackageInfo( getPackageName(), 0).versionCode+","+
					getPackageManager().getPackageInfo( getPackageName(), 0).versionName);
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		btn_download_table_car_setting = (Button) findViewById(R.id.btn_download_table_car_setting);
		btn_download_table_car_setting.setOnClickListener(this);
		
		btn_download_table_jixie_setting = (Button) findViewById(R.id.btn_download_table_jixie_setting);
		btn_download_table_jixie_setting.setOnClickListener(this);	
		
		btn_system_exit = (Button) findViewById(R.id.btn_system_exit);
		btn_system_exit.setOnClickListener(this);
		
		btn_printer = (Button) findViewById(R.id.btn_printer);
		btn_printer.setOnClickListener(this);
		btn_printer_n = (Button) findViewById(R.id.btn_printer_n);
		btn_printer_n.setOnClickListener(this);
		statusText_printer = (TextView) findViewById(R.id.statusText_printer);
		
		btn_download_table_car_setting= (Button) findViewById(R.id.btn_download_table_car_setting);
		btn_download_table_car_setting.setOnClickListener(this);
//
//		btn_download_table_update2= (Button) findViewById(R.id.btn_download_table_update2);
//		btn_download_table_update2.setOnClickListener(this);
//
		btn_download_table_update3= (Button) findViewById(R.id.btn_download_table_update3);
		btn_download_table_update3.setOnClickListener(this);
//		btn_download_table_update4= (Button) findViewById(R.id.btn_download_table_update4);
//		btn_download_table_update4.setOnClickListener(this);
		btn_download_table_update5= (Button) findViewById(R.id.btn_download_table_update5);
		btn_download_table_update5.setOnClickListener(this);
		btn_download_table_update6= (Button) findViewById(R.id.btn_download_table_update6);
		btn_download_table_update6.setOnClickListener(this);
//		btn_download_table_update41= (Button) findViewById(R.id.btn_download_table_update41);
//		btn_download_table_update41.setOnClickListener(this);
//		btn_download_table_update42= (Button) findViewById(R.id.btn_download_table_update42);
//		btn_download_table_update42.setOnClickListener(this);
//		
		btn_download_table_update7= (Button) findViewById(R.id.btn_download_table_update7);
		btn_download_table_update7.setOnClickListener(this);
		btn_download_table_update8= (Button) findViewById(R.id.btn_download_table_update8);
		btn_download_table_update8.setOnClickListener(this);
//		
//		btn_download_table_update_fuwu= (Button) findViewById(R.id.btn_download_table_update_fuwu);
//		btn_download_table_update_fuwu.setOnClickListener(this);
//		
		btn_download_table_update_chexing= (Button) findViewById(R.id.btn_download_table_update_chexing);
		btn_download_table_update_chexing.setOnClickListener(this);		
//		
//		btn_download_table_update4_xiangmu= (Button) findViewById(R.id.btn_download_table_update4_xiangmu);
//		btn_download_table_update4_xiangmu.setOnClickListener(this);
//		btn_download_table_update41_xiangmu= (Button) findViewById(R.id.btn_download_table_update41_xiangmu);
//		btn_download_table_update41_xiangmu.setOnClickListener(this);
//		btn_download_table_update42_xiangmu= (Button) findViewById(R.id.btn_download_table_update42_xiangmu);
//		btn_download_table_update42_xiangmu.setOnClickListener(this);	
		toggleButton_lixian =(ToggleButton) findViewById(R.id.toggleButton_lixian);
		toggleButton_lixian.setOnClickListener(this);

	}
	
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode) {
        case REQUEST_CONNECT_DEVICE:
            // When DeviceListActivity returns with a device to connect
            if (resultCode == Activity.RESULT_OK) {
                // Get the device MAC address
                String address = data.getExtras()
                                     .getString(DeviceListActivity.EXTRA_DEVICE_ADDRESS);
                // Get the BLuetoothDevice object
                BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
                // Attempt to connect to the device
                mService.connect(device);
                statusText_printer.setText(address);
            }
            break;
        }
    }

	@Override
	protected void onResume() {
		super.onResume();
        if (mService != null) {
            // Only if the state is STATE_NONE, do we know that we haven't started already
            if (mService.getState() == BluetoothService3.STATE_NONE) {
              // Start the Bluetooth services
              mService.start();
            }
        }		
	}

	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
		if (mBluetoothAdapter == null) {
			mBluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
		}
        // If BT is not on, request that it be enabled.
        // setupChat() will then be called during onActivityResult
        if (!mBluetoothAdapter.isEnabled()) {
            Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
        }else {
        	if (mService == null) {
        		mService = new BluetoothService3(this, mHandler);
			}
		}	
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

	//离线下载地图的回调方法 OfflineMapDownloadListener
//	@Override
//	public void onDownload(int status, int completeCode, String arg2) {
//		switch (status) {
//		case OfflineMapStatus.SUCCESS:
//			statusText.setText("下载成功");
//			break;
//		case OfflineMapStatus.LOADING:
//			statusText.setText("正在下载," + "已完成：" + completeCode + "%" + arg2);
//			break;
//		case OfflineMapStatus.UNZIP:
//			statusText.setText("正在解压");
//			break;
//		case OfflineMapStatus.WAITING:
//			statusText.setText("正在等待");
//			break;
//		case OfflineMapStatus.PAUSE:
//			statusText.setText("暂停下载");
//			break;
//		case OfflineMapStatus.STOP:
//			statusText.setText("停止下载");
//			break;
//		case OfflineMapStatus.ERROR:
//			statusText.setText("下载错误");
//			break;
//		default:
//			break;
//		}
//	}
	private final Handler mHandler = new Handler(){
		@Override
        public void handleMessage(Message msg) {
            switch (msg.what) {
            case 1:
                switch (msg.arg1) {
                case BluetoothService3.STATE_CONNECTED:
                	Utility.MessageBox("设备连接成功,可以打印!");
                    break;
                case BluetoothService3.STATE_CONNECTING:
                	Utility.MessageBox("正在尝试连接设备");
                    break;
                case BluetoothService3.STATE_LISTEN:
                	Utility.MessageBox("查找设备");
                case BluetoothService3.STATE_NONE:
                	Utility.MessageBox("没有连接到可用打印设备!");
                    break;
                }
                break;

            //case "device_name":
                // save the connected device's name
                //String mConnectedDeviceName = msg.getData().getString("device_name");
                //statusText.setText(mConnectedDeviceName);
               // break;
            //case MESSAGE_TOAST:
             //   Toast.makeText(getApplicationContext(), msg.getData().getString(TOAST),
             //                  Toast.LENGTH_SHORT).show();
             //   break;
            }
        }
	};

	
	public static void FontNormal() {
		//1D 21 00
		byte[] bt = new byte[3];
		bt[0] = 0x1D;
		bt[1] = 0x21;
		bt[2] = 0x00;
		mService.write(bt);
	}

	public static void sendBitMaptoPrinter(byte[] bitmap) {
		try {
	        if (mService.getState() != BluetoothService3.STATE_CONNECTED) {
	            return;
	        }
	        
	        mService.write(bitmap);
	        
//	        byte[] end = { 0x1d, 0x4c, 0x1f, 0x00 };  
	        //mService.write(end);
		} catch (Exception e) {
		}
	}
	
    public static void sendMessagetoPrinter(String message){
    	try {
	        if (mService.getState() != BluetoothService3.STATE_CONNECTED) {
	            return;
	        }
	        if (message.length() > 0) {
	            byte[] send;            
	            try{
	            	send = message.getBytes("GB2312");
	            }
	            catch(UnsupportedEncodingException e)
	            {
	            	send = message.getBytes();
	            }
	            mService.write(send);
	        }			
		} catch (Exception e) {
		}
    }
 
	private TaskListener mTaskListener = new TaskAdapter() {
		public ProgressDialog mDialog;
		@Override
		public void onPostExecute(GenericTask task, TaskResult result) {
			if (mDialog!=null) {
				mDialog.dismiss();
			}
			Submit_System_Setting_Data_Task t = (Submit_System_Setting_Data_Task)task;
			if (result == TaskResult.OK) {
				JSONArray jsonArray = t.pJsonArray;
				MainApplication.pShareUtil.WriteParam(t.pTypeName, jsonArray.toString());
				//editor = getSharedPreferences(FILENAME, MODE_WORLD_WRITEABLE).edit();
				//editor.putString(t.pTypeName, jsonArray.toString());
				Utility.MessageBox(getString(R.string.setting_success_system_data));
			} else {
				Utility.MessageBox(t.mErrorMessage);
			}
		}

		@Override
		public void onPreExecute(GenericTask task) {
			mDialog = Utility.ShowModelDialog(SettingActivity.this, getString(R.string.setting_system_update));
			mDialog.show();
		}
	};
	
	private TaskListener mTaskListener_UpdateFile = new TaskAdapter() {
		public ProgressDialog mDialog;
		@Override
		public void onPostExecute(GenericTask task, TaskResult result) {
			mDialog.dismiss();
			SubmitUpdateTask t = (SubmitUpdateTask)task;
			if (result == TaskResult.OK) {
				Utility.MessageBox(getString(R.string.setting_success_system_data));
//				mSubmitTask = new SubmitUpdateTask();
//				mSubmitTask.setListener(mTaskListener_UpdateFile);
//				params = new TaskParams();
//				params.put(SubmitUpdateTask.UPDATEFILE, 
//						MainApplication.updatefile);
//				
//				mSubmitTask.execute(params);
				UpdateManager manager = new UpdateManager(SettingActivity.this);
				// 检查软件更新
				manager.UPDATEFILE = MainApplication.updatefile;
				manager.checkUpdate();
			} else {
				Utility.MessageBox(t.getMsg());
			}
		}

		@Override
		public void onPreExecute(GenericTask task) {
			mDialog = Utility.ShowModelDialog(SettingActivity.this, getString(R.string.setting_system_update));
			mDialog.show();
		}
	};	
	
	public static void InitGoldelData() {
		String  data;int i;
		try {
			//data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_ZIYOUJIXIE);
			//Submit_System_Setting_Data_Task.A_ZIYOUJIXIE = data.split("\n");
			//data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_WAIZUJIXIE);
			//外租十轮, 外租机械  在界面, 自有机械 固定设置
	        Submit_System_Setting_Data_Task.A_FUWUXIANMU =  MainApplication.Instance.getResources().getStringArray(R.array.fuwumingcheng);
	        Submit_System_Setting_Data_Task.A_ZIYOUJIXIE = MainApplication.Instance.getResources().getStringArray(R.array.ziyoujixie);
	        
	        data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_WAIZUJIXIE);
	        Submit_System_Setting_Data_Task.A_WAIZUJIXIE = data.split("\n");
	        
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_ZIYOUSHILUN);
			Submit_System_Setting_Data_Task.A_ZIYOUSHILUN = data.split("\n");
			
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_GONYINGSHANG);
			Submit_System_Setting_Data_Task.A_GONYINGSHANG = data.split("\n");
			
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_CAILIAOMINGCHENG);
			Submit_System_Setting_Data_Task.A_CAILIAOMINGCHENG = data.split("\n");
			
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_ZHUANGDI);
			Submit_System_Setting_Data_Task.A_ZHUANGDI = data.split("\n");
			
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_XIEDI);
			Submit_System_Setting_Data_Task.A_XIEDI = data.split("\n");
			data = MainApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_CHEXING);
			Submit_System_Setting_Data_Task.A_CHEXING = data.split("\n");
			//data = ECApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_SIJI);
			//Submit_System_Setting_Data_Task.a = data.split("\n");			
//			data = ECApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_ALLCHEPAI);
			//Submit_System_Setting_Data_Task.A_CHEXING = data.split("\n");			
			//data = ECApplication.pShareUtil.ReadParam(Submit_System_Setting_Data_Task.T_FUWUXIANMU);

		} catch (Exception e) {
		}
	}

}
